package com.lipy.dubbodb.mapper.impl;

import com.lipy.dubbocommon.entity.Person;
import com.lipy.dubbodb.mapper.PersonMapper;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @description:
 * @author: lipy
 * @create: 2020-10-22 22:11
 **/
@Component
public class PersonMapperImpl implements PersonMapper {
    @Autowired
    SqlSessionTemplate sqlSessionTemplate;
    @Override
    public List<Person> getAll() {
        return sqlSessionTemplate.selectList("com.lipy.dubbodb.mapper.PersonMapper.getAll");
    }

    @Override
    public Person getOne(Integer integer) {
        return sqlSessionTemplate.selectOne("com.lipy.dubbodb.mapper.PersonMapper.getOne", integer);
    }
}
